Skip to content

Fix broken styles and scripts on extensions page#312

Merged
pfefferle merged 5 commits into
trunkfrom
fix/extensions-page-styles
Mar 28, 2026
Merged

Fix broken styles and scripts on extensions page#312
pfefferle merged 5 commits into
trunkfrom
fix/extensions-page-styles

Conversation

@pfefferle

Copy link
Copy Markdown
Member

Summary

  • Plugin_Installer::enqueue_scripts() referenced Indieweb::$version, a static property that doesn't exist on the Indieweb class
  • This caused a PHP fatal error, preventing installer.css and installer.js from loading on the Extensions page
  • Replaced with the INDIEWEB_VERSION constant, consistent with the rest of the plugin

Test plan

  • Navigate to IndieWeb → Extensions in wp-admin
  • Verify the page renders with proper card layout styling
  • Verify Install/Activate buttons work (JS loaded correctly)

Replace non-existent Indieweb::$version static property with
INDIEWEB_VERSION constant to prevent PHP fatal error that blocked
CSS and JS from loading.
check_file_extension() received null from get_plugin_file() for
uninstalled plugins, triggering a PHP 8.1+ deprecation warning.
The autoloader only loaded the class file when Plugin_Installer was
first referenced during page render, which was after admin_enqueue_scripts
had already fired. Moving initialization into Indieweb::init() ensures
the enqueue hooks are registered early enough for the CSS and JS to load.
Use a custom action (cnkt_installer_enqueue_scripts) triggered from
init() instead of hooking admin_enqueue_scripts globally. This ensures
assets load only on the extensions page and avoids the timing issue
with the autoloader.

Also removes check_file_extension() in favor of a null check, matching
upstream's fix for the strrchr deprecation.
@pfefferle pfefferle merged commit 63972df into trunk Mar 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant